<!-- 统计服务 -->
<template>
  <div>
    <!-- 应用统计 -->
    <div class="data-card">
      <div class="title">发送统计</div>
      <ul class="count-list">
        <li class="count-data">
          <span class="label-tip">总发送量</span>
          <span class="label">{{ appCount }}</span>
        </li>
        <li class="count-data">
          <span class="label-tip">成功量</span>
          <span class="label">{{ functionCount }}</span>
        </li>
        <li class="count-data">
          <span class="label-tip">异常量</span>
          <span class="label">{{ accountCount }}</span>
        </li>
      </ul>
    </div>

    <!-- 权限设置 -->
    <div class="rbac-data-card">
        <v-chart class="chart" :option="option" />
    </div>
  </div>
</template>

<script>

import VChart from "vue-echarts";

export default {
  components: {
      VChart
  },
  data() {
    return {
      appCount: 10,
      functionCount: 123,
      accountCount: 1200,
      option: {
        title: {
          text: "渠道发送量",
          left: "center"
        },
        tooltip: {
          trigger: "item",
          formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
          orient: "vertical",
          left: "left",
          data: [
            "阿里云短信",
            "腾讯云短信",
            "163邮箱",
            "华为云短信",
            "阿里云邮箱"
          ]
        },
        series: [
          {
            name: "渠道统计",
            type: "pie",
            radius: "55%",
            center: ["50%", "60%"],
            data: [
              { value: 335, name: "阿里云短信" },
              { value: 310, name: "腾讯云短信" },
              { value: 234, name: "163邮箱" },
              { value: 135, name: "华为云短信" },
              { value: 135, name: "阿里云邮箱" }
            ],
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: "rgba(0, 0, 0, 0.5)"
              }
            }
          }
        ]
      }
    };
  },
  methods: {},
};
</script>

<style scoped lang="scss">

.chart {
  height: 380px;
}

.data-card {
  border: 1px solid #e3e4e6;
  background: #fff;
  border-radius: 2px;
  padding: 20px;
  float: left;
  width: 100%;
  margin-bottom: 20px;

  .title {
    margin-top: 0px;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 500;
  }

  ul.count-list {
    list-style: none;
    float: left;
    padding: 0px;
    margin: 0px;
    width: 100%;

    li.count-data {
      float: left;
      background: #f7f9fa;
      border-color: #f7f9fa;
      flex: 1;
      height: auto;
      position: relative;
      text-align: left;
      margin-right: 8px;
      padding: 12px;
      width: calc(33.33% - 8px);
      text-decoration: none;
      overflow: hidden;
      border-width: 1px;
      border-style: solid;
      border-radius: 2px;
      transition: all 0.1s linear;
      text-align: left;

      span.label-tip {
        width: 100%;
        float: left;
        font-size: 12px;
      }
      span.label {
        color: #333;
        display: block;
        line-height: 36px;
        font-size: 20px;
      }
    }
  }
}

.rbac-data-card {
  border: 1px solid #e3e4e6;
  background: #fff;
  border-radius: 2px;
  padding: 20px;
  float: left;
  width: 100%;
  margin-bottom: 20px;

  .title {
    margin-top: 0px;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 500;
  }

  .childAccount {
    background: #f7f9fa;
    padding: 8px;
    color: #565050;
    word-break: break-all;
    font-size: 12px;
    margin-top: 20px;
    float: left;
    width: 100%;
    line-height: 15px;
  }

  ul.count-list {
    list-style: none;
    float: left;
    padding: 0px;
    margin: 0px;
    width: 100%;

    li.count-data {
      float: left;
      background: #f7f9fa;
      border-color: #f7f9fa;
      flex: 1;
      height: auto;
      position: relative;
      text-align: left;
      margin-right: 8px;
      padding: 12px;
      width: calc(25% - 8px);
      text-decoration: none;
      overflow: hidden;
      border-width: 1px;
      border-style: solid;
      border-radius: 2px;
      transition: all 0.1s linear;
      text-align: left;

      span.label-tip {
        width: 100%;
        float: left;
        font-size: 12px;
      }
      span.label {
        color: #333;
        display: block;
        line-height: 36px;
        font-size: 13px;
      }
    }
  }

  ul.quickEntry {
    display: flex;
    justify-content: space-between;
    padding: 0px;
    margin: 0px;
    float: left;
    width: 100%;
    font-size: 12px;
    margin-top: 20px;

    li {
      display: inline-block;
      flex-grow: 1;
      flex-basis: 0;
      flex-basis: 0;
      border: 1px solid #c0c6cc;
      text-align: center;
      margin-right: 5px;
      border-radius: 2px;
      font-size: 12px;
      font-weight: 600;
      color: #333;

      a {
        color: #333;
        cursor: pointer;
      }
    }
  }
}
</style>


